<template>
  <el-card class="box-card">
    <template #header>
      <div class="card-header">
        <span>车站管理</span>
        <div style="display: flex">
          <CityAutocomplete></CityAutocomplete>
          <el-button type="primary" :icon="Plus" @click="btn_showDialog">新增</el-button>
        </div>
      </div>
    </template>
    <StationListTable></StationListTable>
  </el-card>
  <ScheduleDialog></ScheduleDialog>
</template>

<script setup>
import { Plus } from '@element-plus/icons-vue'
import ScheduleDialog from './ScheduleDialog.vue'
import StationListTable from './StationListTable.vue'
import CityAutocomplete from './CityAutocomplete.vue'

// import { storeToRefs } from 'pinia'

import { useStationStore } from '../../stores/station'

const stationStore = useStationStore()

// const { dialogFormVisible, dialogFormTitle, formdata } = storeToRefs(stationStore)
const btn_showDialog = () => {
  stationStore.preInfo4Add()
}
</script>

<style>
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.text {
  font-size: 14px;
}

.item {
  margin-bottom: 18px;
}

.box-card {
  margin-top: 1rem;
  width: 100%;
  border-radius: 1rem;
}
</style>
